﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>果之-登录</title>
    <link href="css/guozhi.css" rel="stylesheet" type="text/css">
</head>
<body>
    <form id="frmLogin">
    <div class="container">
        <!--#include file="common/header.htm"-->
        <script src="Scripts/gz_.fmEngine.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                var options = {
                    beforeSubmit: showRequest,
                    success: showResponse,
                    url: "/ajax/ajaxcustomer.ashx",
                    type: "POST",
                    data: { methodName: "CustomerLogin" },
                    clearForm: true
                };
                $('#frmLogin').ajaxForm(options);



                if (GetCookie("gz_customer")) {
                    $("#txtEmail").val($.evalJSON(GetCookie("gz_customer")).Email)
                } else
                    $("#txtEmail").val("");
            });

            function showRequest(formData, jqForm, options) {
                if ($.trim($("#txtEmail").val()) == "") {
                    alert("请输入emial"); return false;
                }
                if ($.trim($("#txtPwd").val()) == "") {
                    alert("请输入密码"); return false;
                }
                return true;
            }


            function showResponse(responseText, statusText, xhr, $form) {
                if (responseText.indexOf("用户名或者密码输入不正确") > -1) {
                    alert(responseText);
                }
                else if (responseText.indexOf("登录成功") > -1) {
                    window.location.href = GetQueryString("rurl");
                }
            }

            function GetQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if (r != null)
                    return unescape(r[2]);
                return null;
            } 
        </script>
        <!--#include file="common/quickBuy.htm"-->
        <div class="login_bg">
            <div class="login_text">
                <span class="login_zc"><a href="register.aspx">
                    <img src="images/gz_dl_13.gif" width="76" height="31" border="0" /></a></span>
                <div class="table_lg">
                    <table width="390" cellspacing="0">
                        <tr>
                            <td class="style3">
                                登陆邮件地址 / Email
                            </td>
                            <td class="style2">
                                <input type="text"  id="txtEmail" name="txtEmail" class="input_text2" autocomplete="off" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style3">
                                登录密码 / Password
                            </td>
                            <td class="style2">
                                <input type="password"  id="txtPwd" name="txtPwd" class="input_text2" autocomplete="off"/>
                            </td>
                        </tr>
                    </table>
                </div>
                <span class="login_bt">
                    <input type="submit" id="btnLogin" value="" style="background-image: url(images/gz_dl_23.gif);
                        width: 100px; height: 39px; border:0px;" />
                </span>
            </div>
        </div>
        <!--#include file="common/bottom.htm"-->
    </div>
    </form>
</body>
</html>
